package org.springcloud.wisdom.spring_01_canteen.mall;

import org.springcloud.wisdom.spring_01_canteen.admin.CanMallService;
import org.springcloud.wisdom.spring_01_canteen.common.bean.ResponseData;
import org.springcloud.wisdom.spring_01_canteen.common.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping("/mall")
public class MallController extends BaseController {
    @Autowired
    private MallService mallService;
    //查看所有商家
    //分页条件查询
    @RequestMapping("/getPages")
    public ResponseData<Object> getMall(
            @RequestParam("pageNum") int pageNum,
            @RequestParam("pageSize") int pageSize,
            @RequestParam(value = "canteen",required = false) String canteen){
        return returnObject(mallService.getOnrePage(pageNum,pageSize,canteen));
    }
}
